<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>项目管理挣值计算</title>
    <link rel="stylesheet" href="styles.css">
    <script src="/chart.js"></script>
</head>
<body>
    <div class="container">
        
        <h1>项目管理挣值计算</h1>
        <form id="project-form">
            <label for="pv">计划值 (PV):</label>
            <input type="number" id="pv" step="any" required>

            <label for="ac">实际成本 (AC):</label>
            <input type="number" id="ac" step="any" required>

            <label for="ev">挣值 (EV):</label>
            <input type="number" id="ev" step="any" required>

            <button type="button" onclick="calculate()">计算</button>
        </form>

        <div id="results">
            <h2>计算结果</h2>
            <p><strong>成本偏差 (CV):</strong> <span id="cv"></span></p>
            <p><strong>进度偏差 (SV):</strong> <span id="sv"></span></p>
            <p><strong>成本绩效指数 (CPI):</strong> <span id="cpi"></span></p>
            <p><strong>进度绩效指数 (SPI):</strong> <span id="spi"></span></p>
            <p><strong>成本偏差分析:</strong></p>
            <p id="analysis"></p>
            
            <!-- 图表容器 -->
            <div class="chart-container">
                <canvas id="costChart" width="400" height="400"></canvas>
            </div>
        </div>
    </div>

    <script src="script.js"></script>
</body>
</html>
